fix!: Fix opts for methods listing issues and sub-issues#4016
fix!: Fix opts for methods listing issues and sub-issues#4016gmlewis merged 3 commits intogoogle:masterfrom
opts for methods listing issues and sub-issues#4016Conversation
|
WHUPS! It looks like I jumped the gun for v83. Ah, well... sorry about that. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4016 +/- ##
==========================================
- Coverage 94.04% 94.04% -0.01%
==========================================
Files 207 207
Lines 19174 19206 +32
==========================================
+ Hits 18033 18063 +30
- Misses 939 940 +1
- Partials 202 203 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Could we retrigger the lint step? Something wrong with the GitHub API. |
|
It looks like the test for |
and possibly the other methods too... see #4019 for more details. |
|
@gmlewis I fixed the test But it's impossible to cover these lines:
|
Even with something like this? opts := &ListAllIssuesOptions{Filter: "\n"} |
Yes. I tried the following test: func TestIssuesService_ListAllIssues_badOptions(t *testing.T) {
t.Parallel()
ctx := t.Context()
client, mux, _ := setup(t)
mux.HandleFunc("/issues", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeReactionsPreview)
fmt.Fprint(w, `[{"number":1}]`)
})
const methodName = "ListAllIssues"
testBadOptions(t, methodName, func() (err error) {
_, _, err = client.Issues.ListAllIssues(ctx, &ListAllIssuesOptions{
Filter: "\n",
})
return err
})
}$ go test -run=^TestIssuesService_ListAllIssues_badOptions$ ./...
--- FAIL: TestIssuesService_ListAllIssues_badOptions (0.00s)
issues_test.go:88: bad options ListAllIssues err = nil, want error
FAIL
FAIL github.com/google/go-github/v82/github 0.571s
? github.com/google/go-github/v82/test/fields [no test files]
? github.com/google/go-github/v82/test/integration [no test files]
FAIL |
Ah! You are absolutely right! The URL becomes |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @alexandear!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
|
Thank you, @Not-Dhananjay-Mishra! |
opts for methods listing issues and sub-issues


BREAKING CHANGE: Split
IssuesService.ListintoIssuesService.ListAllIssuesandIssuesService.ListUserIssues.IssuesService.ListByOrgnow acceptsIssueListByOrgOptions.SubIssueService.ListByIssuenow acceptsListOptions.Updates #3976
Closes #3694